#include "GameDataManager.hpp"

const string GameDataManager::FILE_NAME = "game.dat";

GameDataManager::GameDataManager() {
}

bool GameDataManager::gameDataExists() {
    ifstream checker(GameDataManager::FILE_NAME.c_str());
    bool exists = checker.good();
    checker.close();
    return exists;
}

char GameDataManager::loadGame() {
    ifstream loader(GameDataManager::FILE_NAME.c_str());
    char level = loader.get();
    loader.close();
    return level;
}

void GameDataManager::saveGame(char level) {
    ofstream writer(GameDataManager::FILE_NAME.c_str());
    writer.write(&level, 1);
    writer.close();
}
